package com.lamda.zhekou.manager.impl;

import com.lamda.zhekou.dao.UserVpsDao;
import com.lamda.zhekou.manager.VPSRecordManager;
import com.lamda.zhekou.model.UserVps;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by MJiao on 15/8/16.
 */
@Service
public class VPSRecordManagerImpl implements VPSRecordManager {

    @Autowired
    private UserVpsDao userVpsDao;

    @Override
    public int getVPSRecordCountByUserId(Long userId) {
        List<UserVps> results = this.userVpsDao.findVPSRecordListByUserId(userId);
        return results != null ?  results.size() : 0;
    }
}
